Chapter 1 - Introduction

Each section has a short paragraph written in green the top to give an idea of the contents of the section. This section gives a brief overview of what ReWrite is, and what you need to run it.

Introduction

   ReWrite is a small self contained compiler which uses a rewrite rule syntax which is usually the domain of functional languages, but underneath works in an applicative way, in that it is completely compiled (there is no 'eval' mechanism) and compiles to code that doesn't need complicated memory management such as garbage collection.
    It is designed as a testbench for exploring the power of this style of programming without moving to a full functional environment such as Haskell, ML, Miranda, Clean etc., or dealing with slow interpreters such as Mathematica™. It is eventually intended for use as a full programming language, but this will require a lot more work.
   One of the most notable features of ReWrite is that the compiler is written in itself, demonstrating the power of using rewrite rules for programming.

The main features of ReWrite are:

   •  it uses the syntax of rewrite rules to define functions;

   •  it has the non-destructive attributes of a functional language, in that that there are no side effects (except such things as screen output);

   • it has no evaluation mechanism, so is a purely eager  language (like Pascal);

   •  it compiles to moderately efficient 68020/68030 machine code;

   •  in the compiler, rules are interleaved, so similar rules execute quickly;

   •  it is weakly typed - types may be checked at runtime;

   •  it is in a sense a minimal language - it only has a simple syntax;

   •  although making extensive use of lists, it neither has not requires any garbage collection mechanism - all functions clean up after themselves;

   • The ReWrite compiler is relatively small and clean and written in ReWrite itself.

System requirements

   ReWrite will run on any Macintosh with at least a 68020 CPU and at least 1 Megabyte of memory to run it. It probably also requires System 7.0 or later, although it may (I have no way of checking this) run under some versions of System 6. It will run in emulation on a PowerMac, although will take no advantage of the ability to run native code.

   ReWrite was designed mostly on a Macintosh Classic, then moved to an LC III (where 68000 compatibility was quickly abandoned).